
var marqueeString = new Array();
	marqueeString[0] = '<span>【公告】</span><a href="#">福建获得天使投资案例数16个 金额近亿元</a><br />';
	marqueeString[1] = '<span>【公告】</span> <a href="#">百年学村打造研学旅行之都</a>  <br />';

var marqueeInterval = new Array();
var marqueeId       = 0;
var marqueeDelay    = 2000;
var marqueeSpeed    = 20;
var marqueeHeight   = 25;


function InitMarquee()
{
	$.getJSON("json/title.json", function(data) {
   var str=data[0].title;
//	var str      = marqueeString[0];
	var newsArea = document.getElementById("shownews");
	newsArea.className = "";
	newsArea.innerHTML = '<div id="marqueeBox" style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'StartMarquee()\',marqueeDelay)"><div>'+str+'</div></div>';
	marqueeId++;
	marqueeInterval[0] = setInterval("StartMarquee()", marqueeDelay);
	})

}


function StartMarquee()
{
	var str = marqueeString[marqueeId];
	marqueeId++;

	if(marqueeId >= marqueeString.length)
	{
		marqueeId = 0;
	}

	if(marqueeBox.childNodes.length == 1)
	{
		var NextLine = document.createElement('div');
		NextLine.innerHTML = str;
		marqueeBox.appendChild(NextLine);
	}

	else
	{
		marqueeBox.childNodes[0].innerHTML = str;
		marqueeBox.appendChild(marqueeBox.childNodes[0]);
		marqueeBox.scrollTop = 0;
	}

	clearInterval(marqueeInterval[1]);
	marqueeInterval[1] = setInterval("scrollMarquee()", marqueeSpeed);
}

function scrollMarquee()
{
	marqueeBox.scrollTop++;
	if(marqueeBox.scrollTop % marqueeHeight == (marqueeHeight-1))
	{
		clearInterval(marqueeInterval[1]);
	}
}

InitMarquee();